import request from './request'
import type { DeviceData } from '../types/greenhouse'

// 获取设备实时数据
export const getDeviceData = () => {
  return request({
    url: '/api/device/data',
    method: 'GET'
  })
}

// 获取历史数据
export const getHistoryData = (params: {
  deviceId: number
  startTime: string
  endTime: string
}) => {
  return request({
    url: '/api/device/history',
    method: 'GET',
    params
  })
} 